import request from '@/plugins/request';

// 根据 championId 获取英雄技能详情
export function getChampionSpellById(championId) {
    return request.get(`/selectSpell/${championId}`)
}


// 获取  英雄技能数据
export function getChampionSpell(
    {
        pageNum = 0,
        pageSize = 20,
        val = 1,
        find = "",
    } = {}
) {
    return request.get('/selectChampionSpell', {
        params: { pageNum, pageSize, val ,find}
    })
}

// 更新英雄技能数据
export function updateChampionSpell(spell) {
    return request.put('/updateChampionSpell', spell)
}

// 新增英雄技能数据
export function addChampionSpell(spell) {
    return request.post('/addChampionSpell', spell)
}

// 删除英雄技能数据
export function deleteChampionSpellById(id) {
    return request.delete(`/deleteChampionSpellById/${id}`)
}